/*************************************************************************
> File Name: fibonacci.c
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-07-31 20:30:50
> Description: 斐波那契数列 1、2、3、5、8、13、21、34…
************************************************************************/

#include <stdio.h>
int fibonacci(int n);
int main(int argc, char const *argv[])
{
    printf("fib 20 = %d\n", fibonacci(20));
    return 0;
}

int fibonacci(int n)
{
    if (n == 1 || n == 2)
    {
        return 1;
    }
    return fibonacci(n - 1) + fibonacci(n - 2);
}